| Conditions | 1 |
| Paths | 1 |
| Total Lines | 64 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | // Karma configuration |
||
| 8 | module.exports = function (config) { |
||
| 9 | config.set({ |
||
| 10 | |||
| 11 | // base path that will be used to resolve all patterns (eg. files, exclude) |
||
| 12 | basePath: '.', |
||
| 13 | |||
| 14 | |||
| 15 | // frameworks to use |
||
| 16 | // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
||
| 17 | frameworks: ['jasmine'], |
||
| 18 | |||
| 19 | |||
| 20 | // list of files / patterns to load in the browser |
||
| 21 | files: [ |
||
| 22 | 'js/lib/data/tlds.js', |
||
| 23 | 'js/lib/parseTLD.js', |
||
| 24 | 'js/lib/parseUrl.js', |
||
| 25 | { pattern: 'tests/**/*.js', included: true } |
||
| 26 | ], |
||
| 27 | |||
| 28 | |||
| 29 | // list of files to exclude |
||
| 30 | exclude: [ |
||
| 31 | ], |
||
| 32 | |||
| 33 | |||
| 34 | // preprocess matching files before serving them to the browser |
||
| 35 | // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
||
| 36 | preprocessors: {}, |
||
| 37 | |||
| 38 | |||
| 39 | // test results reporter to use |
||
| 40 | // possible values: 'dots', 'progress' |
||
| 41 | // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
||
| 42 | reporters: ['verbose'], |
||
| 43 | |||
| 44 | |||
| 45 | // web server port |
||
| 46 | port: 9876, |
||
| 47 | |||
| 48 | |||
| 49 | // enable / disable colors in the output (reporters and logs) |
||
| 50 | colors: true, |
||
| 51 | |||
| 52 | |||
| 53 | // level of logging |
||
| 54 | // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
||
| 55 | logLevel: config.LOG_INFO, |
||
| 56 | |||
| 57 | |||
| 58 | // enable / disable watching file and executing tests whenever any file changes |
||
| 59 | autoWatch: false, |
||
| 60 | |||
| 61 | |||
| 62 | // start these browsers |
||
| 63 | // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher |
||
| 64 | browsers: browsers, |
||
| 65 | |||
| 66 | |||
| 67 | // Continuous Integration mode |
||
| 68 | // if true, Karma captures browsers, runs the tests and exits |
||
| 69 | singleRun: true |
||
| 70 | }); |
||
| 71 | }; |